import React, { Component } from 'react';
import {HashRouter as Router,Route} from "react-router-dom"

const Home = ()=>{
  return <h1>
    主页
  </h1>
}
const User =()=>{
  return <h1>
    用户组件
  </h1>
}
class App extends Component {
  render() {
    return (
      <Router>
        {/* 属性 exact 精确匹配路由 path.indexOf("/user")*/}
        <Route exact path="/" component={Home}></Route>
        <Route path="/user" component={User}></Route>
      </Router>
    );
  }
}

export default App;
